package com.googlecode.marrowboy.testutil;

import java.io.FileNotFoundException;
import java.io.PrintStream;

import com.googlecode.marrowboy.MarrowBoy;
import com.googlecode.marrowboy.writers.Templates;

public class MarrowBoyReportHelper {

	public static void initialiseMarrowBoyWriters() {

		String fileBase = System.getProperty("marrowBoyReportFileBase");

		try {

			MarrowBoy.getTestLogger().clearReportWriters();

			MarrowBoy.getTestLogger().addReportTemplate(Templates.DEFAULT_PLAIN_TEXT_TEMPLATE, new PrintStream(fileBase + ".txt"));
			MarrowBoy.getTestLogger().addReportTemplate(Templates.DEFAULT_HTML_TEMPLATE, new PrintStream(fileBase + ".html"));
			MarrowBoy.getTestLogger().addReportTemplate(Templates.DEFAULT_XML_TEMPLATE, new PrintStream(fileBase + ".xml"));

		} catch (FileNotFoundException e) {
			throw new RuntimeException(e);

		}
	}

}
